﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PingPong 
{
    /// <summary>
    /// Classe abstrata porque eu não quero instanciar objetos diretamente dela
    /// </summary>
    abstract class Object
    {
        /// <summary>
        /// Atributos protegidos para serem visíveis nas classes herdadas
        /// </summary>
        protected Texture2D texture;
        protected Rectangle size;
        protected Vector2 velocity;
        protected Vector2 position;
        public Vector2 Position
        {
            get
            {
                return position;
            }
            set
            {
                position = value;
            }
        }
        //mudança aqui para ser acessível
        public Rectangle Size
        {
            get
            {
                return size;
            }
            set
            {
                size = value;
            }
        }

        public Object( 
            GameWindow janela ,
            Texture2D texture,
            Vector2 position)
        {
            
            this.texture = texture;
            this.size = texture.Bounds;
            this.position = new Vector2(
                janela.ClientBounds.Width/2
                - this.size.Width/2 ,
                janela.ClientBounds.Height/2
                - this.size.Height/2);
        }

        /// <summary>
        /// Força que as classes derivadas implementem esse método, mesmo que vazio...
        /// bom para lembrar de colocar o update...
        /// </summary>
        public abstract void Update();
        
        public abstract void Draw(SpriteBatch spriteBatch);
        
    }
}
